<template>
    <view class="h5" v-if="isShow">
        <web-view :src="url"></web-view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            isShow: false,
            url: ''
        };
    },
    onLoad(options) {
        if (options.url) {
            this.url = options.url;
            this.isShow = true;
        } else {
            this.getUrl();
        }
    },
    methods: {
        getUrl() {
            this.$service.wxjlj
                .getConfig()
                .then(res => {
                    this.url = res.joinGroupQRCode;
                    this.isShow = true;
                })
                .catch(err => {
                    uni.showToast({
                        title: err,
                        icon: 'none'
                    });
                });
        }
    }
};
</script>

<style lang="scss" scoped>
.h5 {
    height: 100%;
    width: 100%;
}
</style>
